local gegui = fk.CreateSkill{
    name = "lingling__gegui",
}
Fk:loadTranslationTable{
    ["lingling__gegui"] = "革规",
    [":lingling__gegui"] = "你可以将一张黑桃牌当任意基本牌使用或打出，每回合每种基本牌限一次。",
    ["#lingling__gegui"] = "革规：你可以将一张黑桃牌当任意基本牌使用或打出",
}

gegui:addEffect("viewas",{
    pattern = ".|.|.|.|.|basic",
    prompt = "#lingling__gegui",
    interaction = function(self, player)
        local all_names = Fk:getAllCardNames("b")
        local names = player:getViewAsCardNames(gegui.name, all_names, nil, player:getTableMark("lingling__gegui-turn"))
        if #names > 0 then
        return UI.CardNameBox { choices = names, all_choices = all_names }
        end
    end,
    handly_pile = true,
    card_filter = function(self, player, to_select, selected)
        return #selected == 0 and Fk:getCardById(to_select).suit == Card.Spade
    end,
    view_as = function(self, player, cards)
        if #cards ~= 1 or not self.interaction.data then return end
        local card = Fk:cloneCard(self.interaction.data)
        card:addSubcards(cards)
        card.skillName = gegui.name
        return card
    end,
    before_use = function(self, player, use)
        player.room:addTableMark(player, "lingling__gegui-turn", use.card.trueName)
    end,
    enabled_at_play = function (self, player)
        return not player:isNude() and #player:getViewAsCardNames(gegui.name, Fk:getAllCardNames("b"), nil, player:getTableMark("lingling__gegui-turn")) > 0
    end,
    enabled_at_response = function (self, player, response)
        return not player:isNude() and #player:getViewAsCardNames(gegui.name, Fk:getAllCardNames("b"), nil, player:getTableMark("lingling__gegui-turn")) > 0
    end,
})

return gegui